package cn.com.fattiger.singleton;

/**
 * 
 * StaticClassSingleton
 * @author fattiger.xiaoyang
 * @date 2017/03/14
 * @qqGroup 454655009
 */
public class StaticClassSingleton {

	//内部类 第一次使用的时候才加载 且 只有SingletonHolder类能访问
	//static域中修改共享变量是线程安全的，由JVM保证
	private static class SingletonHolder {
		static StaticClassSingleton INSTANCE = new StaticClassSingleton();
	}

	public static StaticClassSingleton getInstance() {
		return SingletonHolder.INSTANCE;
	}
}
